<template>
  <div>
    <el-button
      type="success"
      style="height: 30px; width: 50px; text-align: center"
      @click="add"
      >添加</el-button
    >
    <v-dialog :info="info" ref="dialog"></v-dialog>
    <v-list @edit="edit"></v-list>
  </div>
</template>
 
<script>
import vDialog from "./components/Dialog.vue";
import vList from "./components/List.vue";
export default {
  data() {
    return {
      info: {
        isShow: false,
        title: "",
        isAdd: true,
      },
    };
  },
  methods: {
      add(){
          this.info.isShow=true;
          this.info.title="角色添加";
          this.info.isAdd=true;
      },
      edit(id){
          this.info.isShow=true;
          this.info.title="角色修改";
          this.info.isAdd=false;
          this.$refs.dialog.goDetail(id);
      }
  },
  components: {
    vDialog,
    vList,
  },
   mounted(){
       document.title=this.$route.meta.title
  }
};
</script>
<style scoped>
.el-button{
  line-height: 30px;
  margin: 10px 0px;
  padding:0;
}
</style>